# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=ffmpegthumbs
pkgver=24.02.2
pkgrel=0
# armhf blocked by extra-cmake-modules
# not useful on s390x
arch="all !s390x !armhf"
url="https://www.kde.org/applications/multimedia/"
pkgdesc="FFmpeg-based thumbnail creator for video files"
license="GPL-2.0-or-later"
makedepends="
	extra-cmake-modules
	ffmpeg-dev
	kconfig-dev
	ki18n-dev
	kio-dev
	qt6-qtbase-dev
	samurai
	taglib-dev
	"
_repo_url="https://invent.kde.org/multimedia/ffmpegthumbs.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/ffmpegthumbs-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4032c489c97231ff9a0d68b2a1ae35ed886962e99d12df7781d4f1f6408a6e2f1fdf5e15cce3b639b2e839467265c6ba6a2133b10cd7ae5225682db710bbb1d7  ffmpegthumbs-24.02.2.tar.xz
"
